# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Jason Chu <jchu@xentac.net>

pkgname=wireless_tools
pkgver=30.pre9
_pkgver=${pkgver%.pre*}
pkgrel=3
pkgdesc='Tools allowing to manipulate the Wireless Extensions'
url='https://hewlettpackard.github.io/wireless-tools/Tools.html'
license=('GPL')
arch=('x86_64')
source=("https://hewlettpackard.github.io/wireless-tools/${pkgname}.${pkgver}.tar.gz")
sha256sums=('abd9c5c98abf1fdd11892ac2f8a56737544fe101e1be27c6241a564948f34c63')

prepare() {
	cd "${srcdir}/${pkgname}.${_pkgver}"
	sed '/BUILD_STATIC =/d' -i Makefile
}

build() {
	cd "${srcdir}/${pkgname}.${_pkgver}"
	make CFLAGS="${CFLAGS} -I." LDFLAGS="${LDFLAGS}"
}

package() {
	cd "${srcdir}/${pkgname}.${_pkgver}"
	make \
		INSTALL_DIR="${pkgdir}/usr/bin" \
		INSTALL_LIB="${pkgdir}/usr/lib" \
		INSTALL_INC="${pkgdir}/usr/include" \
		INSTALL_MAN="${pkgdir}/usr/share/man" \
		install
}
